/**
 * 采购订单表 api 封装
 *
 * @Author:    zzw
 * @Date:      2024-10-08 17:37:12
 * @Copyright  jz
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const purchaseOrderApi = {
  /**
   * 分页查询  @author  zzw
   */
  queryPage: (param) => {
    return postRequest('/purchaseOrder/queryPage', param);
  },

  /**
   * 增加  @author  zzw
   */
  add: (param) => {
    return postRequest('/purchaseOrder/add', param);
  },

  /**
   * 修改  @author  zzw
   */
  update: (param) => {
    return postRequest('/purchaseOrder/update', param);
  },

  /**
   * 删除  @author  zzw
   */
  delete: (id) => {
    return getRequest(`/purchaseOrder/delete/${id}`);
  },

  /**
   * 批量删除  @author  zzw
   */
  batchDelete: (idList) => {
    return postRequest('/purchaseOrder/batchDelete', idList);
  },

  /**
   * 项目下拉  @author  zzw
   */
  project: (idList) => {
    return postRequest('/project/queryAll', idList);
  },

  /**
   * 供应商下拉  @author  zzw
   */
  subcontractorInfo: (idList) => {
    return postRequest('/subcontractorInfo/queryAll', idList);
  },
  
  /**
   * 供应商下拉  @author  zzw
   */
  goods: (idList) => {
    return postRequest('/goods/queryAll', idList);
  },
  //同意审批
  approve:(id)=>{
    return getRequest(`/purchaseOrder/approve/${id}`);
  },
  
  // 不同意审批
  notApprove:(param)=>{
    return getRequest(`/purchaseOrder/notApprove/`,param);
  }
};
